<?php include 'partials/header.php'; ?>


<div class="jumbotron">
    <h1>CS:GO  &Eacute;laborez une strat&eacute;gie</h1>
    <p>Ajoutez vos joueurs et définissez votre strat&eacute;gie</p>
</div>
<div id="warningBox"></div>
<div class="col-lg-3">                                        
    <div class="panel panel-primary" name="listBoxContainer" id="listBoxContainer">
        <div class="panel-heading">
            <h3 class="panel-title">Liste des joueurs</h3>
        </div>
        <div class="panel-body">
            <div class="input-group">
                <span class="input-group-btn">
                    <button class="btn btn-success" id="btnAddPlayer" onclick="btnAddPlayer();">Ajouter</button>
                </span>
                <input type="text" class="form-control" id="newPlayerName" name="newPlayerName" placeholder="Nom du joueur"/>
            </div>
            <div class="list-group" id="playerList" name="playerList"></div>                        
        </div>
    </div>
</div>
<div class="col-lg-9">
    <?php
    $map_name = "";
    if (!empty($_GET['map'])) {
        switch ($_GET['map']) {
            case "mirage":
                $map_name = 'media/de_mirage.png';
                break;
            case "season":
                $map_name =  'media/de_season.png';
                break;
            case "inferno":
                $map_name =  'media/de_inferno.png';
                break;
        }
    }
    ?>
    <canvas style="background-image: url('<?php echo $map_name;?>'); height: 600px; width: 600px;" onclick='editStrategy(event, this)' id='myCanvas'>
        
    </canvas>
    <span class="input-group-btn btn-group">
        <button class="btn btn-primary" id="btnSave" onclick="showMessage( 'strat_saved', 'Votre stratégie a été sauvegardée.', 'info' );">Sauvegarder</button>
        <button class="btn btn-info" id="btnShare" onclick="alert('haahha');">Partager</button>
    </span>
    <div style="position:absolute;" id="choicesbox"></div>
</div>

<!-- Load the Paper.js library -->
<script type="text/javascript" src="js/paper.js"></script>
<!-- Define inlined PaperScript associate it with myCanvas -->
<script type="text/paperscript" canvas="myCanvas" >

    // TEST, c'est juste pour montrer comment ça march
    // Create an empty project and a view for the canvas:
    
</script>

<?php include 'partials/footer.php'; ?>